﻿Imports System.Xml.Serialization

Public MustInherit Class tagBase

    <XmlAttribute("Name")> Public Name As String

    Public Sub New()

    End Sub

    Protected Sub New(ByVal str As System.IO.Stream, Optional ByVal SkipName As Boolean = False)

        If Not SkipName Then
            Dim encoding As New System.Text.UTF8Encoding

            Dim Len As UInt16
            Len = BitConverter.ToUInt16(ReadBytesFromStream(str, 2).Reverse.ToArray, 0)
            Me.Name = encoding.GetString(ReadBytesFromStream(str, Len))
        End If

    End Sub
End Class
